{extend name="public/base" /} {block name="title"}
<title>评论管理</title>
{__block__}
<link href="//cdn.bootcss.com/datatables/1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/limonte-sweetalert2/6.6.8/sweetalert2.min.css" rel="stylesheet">
<style>
    .checkComment :hover,
    .delComment :hover {
        color: #000;
    }
</style>
<script>
    var indexCommentUrl = "{:url('admin/comment/index')}";
    var checkCommentUrl = "{:url('admin/comment/check')}";
    var delCommentUrl = "{:url('admin/comment/del')}";
</script>
{/block} {block name="page-heading"}
<div class="col-sm-4">
    <h2>评论管理</h2>
    <ol class="breadcrumb">
        <li>
            <a href="{:url('admin/index/home')}">主页</a>
        </li>
        <li>
            <strong>评论管理</strong>
        </li>
    </ol>
</div> {/block} {block name="content"}
<table class="table commentTable table-striped table-hover table-condensed">
    <thead>
        <tr>
            <th></th>
            <th>文章</th>
            <th>内容</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach name="data" item="comment"}
        <tr>
            <td>
                <input type="checkbox" value="{$comment.id}" name="cid">
            </td>
            <td>{$comment.aid|getArticleById}</td>
            <td>{$comment.content|getShortContent}</td>
            <td>{$comment.status}</td>
            <td>
                <a class="text-success checkComment">审核</a>&nbsp;&nbsp;
                <a class="text-danger delComment"><i class="fa fa-trash"></i></a>
            </td>
        </tr>
        {/foreach}
    </tbody>
    <tfoot>
        <tr>
            <th></th>
            <th>文章</th>
            <th>内容</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
    </tfoot>
</table>
<a href="javascript:void(0)" class="btn btn-primary" onclick="selectAll('cid')">全选</a>
<a href="javascript:void(0)" class="btn btn-primary" onclick="selectEmpty('cid')">全不选</a>
<a href="javascript:void(0)" class="btn btn-primary" onclick="selectReverse('cid')">反选</a>
<a href="javascript:void(0)" class="btn btn-danger" id="delSelectedComment">删除选定</a>
<a href="javascript:void(0)" class="btn btn-primary" id="checkSelectedComment">审核选定</a> {/block} {block name="extra"}
<!--查看评论  -->
<div class="modal fade" id="commentModal" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <form class="form-horizontal" role="form" id="commentInfoForm">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">评论审核</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户ID</label>
                        <div class="col-sm-10">
                            <p class="form-control-static" id="checkUid"></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">内容</label>
                        <div class="col-sm-10">
                            <p class="form-control-static" id="checkContent"></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">IP</label>
                        <div class="col-sm-10">
                            <p class="form-control-static" id="checkIp"></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">时间</label>
                        <div class="col-sm-10">
                            <p class="form-control-static" id="checkTime"></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">回复</label>
                        <div class="col-sm-10">
                            <input type="text" name="reply" id="checkReply" class="form-control" placeholder="在此输入回复内容">
                        </div>
                    </div>
                </div>
                <input type="hidden" name="id" id="checkId">
                <div class="modal-footer">
                    <button type="button" id="replyBtn" class="btn btn-primary">回复</button>
                    <button type="submit" class="btn btn-primary">通过/限制</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div> {/block}{block name="script"}{__block__}
<script src="//cdn.bootcss.com/datatables/1.10.15/js/jquery.dataTables.min.js"></script>
<script src="//cdn.bootcss.com/datatables/1.10.15/js/dataTables.bootstrap.min.js"></script>
<script src="//cdn.bootcss.com/limonte-sweetalert2/6.6.8/sweetalert2.min.js"></script>
<script src="__CUSTOME__/js/admin.common.js"></script>
<script>
    $(function () {
        $(".commentTable").dataTable({
            language: {
                url: "__PLUGINS__/dataTables/Chinese.json"
            },
            "columns": [{
                "orderable": false
            }, null, null, null, {
                "orderable": false
            }, ],
        });
    });
</script> {/block}